package com.pig4cloud.pig.floor.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.floor.dto.PropertyFloorDto;
import com.pig4cloud.pig.floor.entity.PropertyFloor;
import com.pig4cloud.pig.floor.mapper.FloorMapper;
import com.pig4cloud.pig.floor.service.FloorService;
import com.pig4cloud.pig.floor.vo.PropertyFloorVo;
import com.pig4cloud.pig.propertyroom.entity.PropertyRoom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class FloorServiceImpl extends ServiceImpl<FloorMapper, PropertyFloor> implements FloorService {
	@Autowired
	private FloorMapper floorMapper;
	@Override
	public Page<PropertyFloorVo> wrapperPage(Page page, PropertyFloorDto propertyFloorDto) {
		return floorMapper.wrapperPage(page, propertyFloorDto);
	}

	@Override
	public PropertyRoom[] selectRoomByFloorId(Long[] ids) {
		return floorMapper.selectRoomByFloorId(ids);
	}

	@Override
	public PropertyFloor checkFloorByNumberAndName(PropertyFloor propertyFloor) {
		return floorMapper.checkFloorByNumberAndName(propertyFloor);
	}

	@Override
	public PropertyFloorVo getFloorById(Long floorId) {
		return floorMapper.getFloorById(floorId);
	}
}
